#pragma once
#include <vector>
#include <map>

template <class T>
class VectorIterator
{
private:
    typename T::iterator mCurrent;
    typename T::iterator mEnd;
    VectorIterator() {};
public:
    typedef typename T::value_type ValueType;
    VectorIterator(typename T::iterator start, typename T::iterator end) : mCurrent(start), mEnd(end) { }
    explicit VectorIterator(T& c) : mCurrent(c.begin()), mEnd(c.end()) { }

    bool hasMoreElements(void) const { return mCurrent != mEnd; }
    typename T::value_type getNext(void) { return *mCurrent++; }
    typename T::value_type peekNext(void) { return *mCurrent; }
    typename T::pointer peekNextPtr(void) { return &(*mCurrent); }
    void moveNext(void) { ++mCurrent; }
};

template <class T>
class ConstMapIterator
{
private:
    mutable typename T::const_iterator mCurrent;
    typename T::const_iterator mEnd;
    ConstMapIterator() {};
public:
    typedef typename T::mapped_type MappedType;
    typedef typename T::key_type KeyType;

    ConstMapIterator(typename T::const_iterator start, typename T::const_iterator end) : mCurrent(start), mEnd(end) { }
    explicit ConstMapIterator(const T& c) : mCurrent(c.begin()), mEnd(c.end()) { }

    bool hasMoreElements(void) const { return mCurrent != mEnd; }
    typename T::mapped_type getNext(void) { return (mCurrent++)->second; }
    typename T::mapped_type peekNextValue(void) const { return mCurrent->second; }
    typename T::key_type peekNextKey(void) const { return mCurrent->first; }
	ConstMapIterator<T> & operator=( ConstMapIterator<T> &rhs ) { mCurrent = rhs.mCurrent; mEnd = rhs.mEnd; return *this; }
    const typename T::mapped_type* peekNextValuePtr(void) const {  return &(mCurrent->second); }
    void moveNext(void) const { ++mCurrent; }
};